<div id="icon-edit" class="icon32 icon32-posts-post"><br></div>
<h2>编辑案例</h2>
<?php if (isset($validationErrors)): ?>
<div class="error">
<?php
    foreach($validationErrors as $field => $messages) {
        echo $field, " : ", $messages[0], "<br/>";
    }
?>
</div>
<?php endif; ?>
<hr/>
<?php
echo $this->Form->create('Admin.Case', array('type' => 'file'));
echo $this->Form->input('Admin.Case.id', array('type'=>'hidden'));
echo $this->Form->input('Admin.Case.title', array('label'=>'案例标题'));
echo $this->Form->input('Admin.Case.service_id', array('label'=>'所属服务'));
echo $this->Form->input('Admin.Case.priority', array('label'=>'优先级', 'type'=>'number'));
echo $this->Form->input('Admin.Case.list_img', array(
    'type' => 'file',
    'label' => '列表缩图',
    'after' => '220x140'
));
echo $this->Html->image('/'.$this->Form->data['Admin']['Case']['list_img']);
echo $this->Form->input('Admin.Case.home_img', array(
    'type' => 'file',
    'label' => '首页缩图',
    'after' => '240x110'
));
echo $this->Html->image('/'.$this->Form->data['Admin']['Case']['home_img']);
echo $this->Form->input('Admin.Case.title_img', array(
    'type' => 'file',
    'label' => '标题图片',
    'after' => '120x40'
));
echo $this->Html->image('/'.$this->Form->data['Admin']['Case']['title_img']);
?>

    <fieldset id="tagList">
        <legend>选择标签</legend>
    <?php
    echo $this->Form->select('Tag.tag_id', $tagList, array(
        'multiple' => 'checkbox',
    ));
    ?>
    </fieldset>
    <div class="input text">
        <label for="AdminCaseDesc">描述</label><br/>
        <?php echo $this->Form->textarea('Admin.Case.desc', array('rows'=>10,'cols'=>100));?>
    </div>
    <ul class="case-intro1 clearfix">
        <li>
            <?php echo $this->Form->input('Admin.Case.features.0.title', array('label'=>'说明标题1'));?>
            <div class="input text">
                <label for="AdminCaseFeatures0Desc">案例说明1</label>
                <?php echo $this->Form->textarea('Admin.Case.features.0.desc', array('rows'=>8,'cols'=>30));?>
            </div>
        </li>
        <li>
            <?php echo $this->Form->input('Admin.Case.features.1.title', array('label'=>'说明标题2'));?>
            <div class="input text">
                <label for="AdminCaseFeatures1Desc">案例说明2</label>
                <?php echo $this->Form->textarea('Admin.Case.features.1.desc', array('rows'=>8,'cols'=>30));?>
            </div>
        </li>
        <li class="borno">
            <?php echo $this->Form->input('Admin.Case.features.2.title', array('label'=>'说明标题3'));?>
            <div class="input text">
                <label for="AdminCaseFeatures2Desc">案例说明3</label>
                <?php echo $this->Form->textarea('Admin.Case.features.2.desc', array('rows'=>8,'cols'=>30));?>
            </div>
        </li>
    </ul>
    <div class="clear"></div>
<?php
foreach (range(0,9) as $i) {
    echo $this->Form->input("Admin.Case.images.$i", array(
        'type' => 'file',
        'label' => '图片'
    ));


    if (isset($this->data['Admin']['Case']['images'][$i])
        && !is_array($this->data['Admin']['Case']['images'][$i])
    ) {
        $imgUrl = $this->data['Admin']['Case']['images'][$i];
        if ($imgUrl) {
            echo $this->Html->image('/'.$imgUrl);
            
        }
    }

}
?>
    <div class="submit">
        <input  type="submit" value="submit"/>
    </div>
</form>
